﻿using System;
using System.Configuration;
using System.Windows.Forms;

using DreamCube.WinForm.Common;

namespace DreamCube.WebServer.WebHost.UI
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(String[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //线程异常捕获
            Application.ThreadException += MyApp.Application_ThreadException;
            if (!DreamCube.Foundation.Basic.Utility.MyApp.IsExistApp(Properties.Resources.AppKey))
            {
                MainForm form = new MainForm(args);
                form.Text = ConfigurationManager.AppSettings["AppName"];
                Application.Run(form);
            }
            else
            {
                MessageBox.Show("只能运行一个程序实例哦，请在右下角双击打开程序！", "重复打开软件提醒");
            }
        }
    }
}
